﻿using System;
using HiTeachers.Data.Manager;
using HiTeachers.Entities;
using HiTeachers.Interfaces;

namespace HiTeachers.Services
{
    public class PaymentInfoServices
    {
        private static readonly IPaymentInfoDao PayInfoDao = NHibernateDaoFactory.Instance.GetPaymentInfoDao();

        public static PaymentInfo GetById(Guid itId)
        {
            return PayInfoDao.GetById(itId, false);
        }

        public static PaymentInfo GetByOrderCode(string ordCode)
        {
            return PayInfoDao.GetByOrderCode(ordCode);
        }

        public static PaymentInfo SaveOrUpdate(PaymentInfo paymentInfo)
        {
            return paymentInfo.ID.Equals(Guid.Empty) ? PayInfoDao.Save(paymentInfo) : PayInfoDao.SaveOrUpdate(paymentInfo);
        }
    }
}
